home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.5)
-
- RSAMD5 = 1
- DH = 2
- DSA = 3
- ECC = 4
- INDIRECT = 252
- PRIVATEDNS = 253
- PRIVATEOID = 254
- _algorithm_by_text = {
- 'RSAMD5': RSAMD5,
- 'DH': DH,
- 'DSA': DSA,
- 'ECC': ECC,
- 'INDIRECT': INDIRECT,
- 'PRIVATEDNS': PRIVATEDNS,
- 'PRIVATEOID': PRIVATEOID }
- _algorithm_by_value = []([ (y, x) for x, y in _algorithm_by_text.iteritems() ])
-
- class UnknownAlgorithm(Exception):
- pass
-
-
- def algorithm_from_text(text):
- value = _algorithm_by_text.get(text.upper())
- if value is None:
- value = int(text)
-
- return value
-
-
- def algorithm_to_text(value):
- text = _algorithm_by_value.get(value)
- if text is None:
- text = str(value)
-
- return text
-
-